﻿// Decompiled with JetBrains decompiler
// Type: System.Web.Razor.Parser.SyntaxTree.BlockBuilder
// Assembly: System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
// MVID: 682513D6-F37E-48AC-9909-F3EE103CFF14
// Assembly location: D:\Project\Idea\无人机外网\uav\客户端工程\排查工具\bin\Release\System.Web.Razor.dll

using System.Collections.Generic;
using System.Web.Razor.Generator;

namespace System.Web.Razor.Parser.SyntaxTree
{
  /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the block builder for the webpages.</summary>
  public class BlockBuilder
  {
    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the <see cref="T:System.Web.Razor.Parser.SyntaxTree.BlockBuilder" /> class.</summary>
    public BlockBuilder() => this.Reset();

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the <see cref="T:System.Web.Razor.Parser.SyntaxTree.BlockBuilder" /> class.</summary>
    /// <param name="original">The original block builder.</param>
    public BlockBuilder(Block original)
    {
      this.Type = new BlockType?(original.Type);
      this.Children = (IList<SyntaxTreeNode>) new List<SyntaxTreeNode>(original.Children);
      this.Name = original.Name;
      this.CodeGenerator = original.CodeGenerator;
    }

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a block type that can be assigned null.</summary>
    /// <returns>A block type that can be assigned null.</returns>
    public BlockType? Type { get; set; }

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the collection of child elements of the block builder.</summary>
    /// <returns>The collection of child elements of the block builder.</returns>
    public IList<SyntaxTreeNode> Children { get; private set; }

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the string name for the block builder.</summary>
    /// <returns>The string name for the block builder.</returns>
    public string Name { get; set; }

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the code generator for the block builder.</summary>
    /// <returns>The code generator for the block builder.</returns>
    public IBlockCodeGenerator CodeGenerator { get; set; }

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Builds a block for this instance.</summary>
    /// <returns>A block builds for this instance.</returns>
    public Block Build() => new Block(this);

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Resets the block builder to its original position.</summary>
    public void Reset()
    {
      this.Type = new BlockType?();
      this.Name = (string) null;
      this.Children = (IList<SyntaxTreeNode>) new List<SyntaxTreeNode>();
      this.CodeGenerator = BlockCodeGenerator.Null;
    }
  }
}
